home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / zunkn.c < prev    next >
C/C++ Source or Header  |  1991-07-11  |  22KB  |  792 lines

  1. /*****************************************************************************
  2.     ZUnkn.c
  3.     System dependent code for an unknown compiler, computer, or
  4. operating system.
  5.  
  6. *****************************************************************************/
  7.  
  8. #include "zport.h"        /* define portability identifiers */
  9. #include "tecoc.h"        /* define general identifiers */
  10. #include "dchars.h"        /* define identifiers for characters */
  11. #include "clpars.h"        /* command-line parsing macro */
  12.  
  13. VVOID exit();
  14. VVOID free();
  15. char *malloc();
  16. char *realloc();
  17. char *strcat();
  18. char *strchr();
  19. char *strcpy();
  20. DEFAULT strlen();
  21.  
  22. /*****************************************************************************
  23.     IFiles holds the file data blocks for input files.  There are three
  24. static input streams:   the primary input stream,  the secondary input stream,
  25. and the input stream used by the EQq command.  To access these three files,
  26. identifiers defined in file tecoc.h are used to index into this array.
  27. Other elements of this array are used to access input files for the EI
  28. command.
  29. *****************************************************************************/
  30.  
  31. /*static    struct    IFDBST    IFiles[NIFDBS];*/
  32.  
  33. /*****************************************************************************
  34.     OFiles holds the file data blocks for the output files.  There are
  35. three output streams:   the primary output stream,  the secondary output
  36. stream and the output stream used by the E%q command.  The array is indexed
  37. using identifiers defined in file tecoc.h.
  38. *****************************************************************************/
  39.  
  40. /*static    struct    OFDBST    OFiles[NOFDBS];*/
  41.  
  42. /*****************************************************************************
  43.  
  44.     ZErMsg()
  45.  
  46.     This function displays error message from the operating system on
  47. the terminal screen.  The error message text is retrieved from the operating
  48. system and imbedded in a TECO-style message with the SYS mnemonic.
  49.  
  50. *****************************************************************************/
  51.  
  52. VVOID ZErMsg(stat1, stat2)
  53. int stat1;
  54. int stat2;
  55. {
  56.     puts("Terminating in function ZErMsg.\n");
  57.     exit(EXIT_FAILURE);
  58. }
  59.  
  60. /*****************************************************************************
  61.  
  62.     ZAlloc()
  63.  
  64.     This function allocates memory.  The single argument is the number of
  65. bytes to allocate.  TECO-C uses the ZFree and ZRaloc functions to de-allocate
  66. and re-allocate, respectively,  the memory allocated by this function.
  67.  
  68. *****************************************************************************/
  69.  
  70. voidptr ZAlloc(MemSize)        /* allocate memory */
  71. SIZE_T MemSize;
  72. {
  73.     return malloc(MemSize);
  74. }
  75.  
  76. /*****************************************************************************
  77.  
  78.     ZBell()
  79.  
  80.     Thus function rings the terminal bell.  For most platforms,  this
  81. means just writing a bell character (control-G) to the terminal.  Under
  82. MS-DOS, ringing the bell this way produces a yucky sound,  so for MS-DOS
  83. this function controls the signal generator directly.
  84.  
  85. *****************************************************************************/
  86.  
  87. VVOID ZBell()
  88. {
  89.     ZDspCh('\7');
  90. }
  91.  
  92. /*****************************************************************************
  93.  
  94.     ZChIn()
  95.  
  96.     This function inputs a single character from the terminal.
  97.  
  98.     1.  the character is not echoed on the terminal
  99.     2.  ^C calls an interrupt routine.  Note that this must be
  100.         implemented so that a ^C will cancel a current output via
  101.         ZDspBf.  The ^C must be a true interrupt.
  102.     3.  type-ahead is always nice
  103.     4.  The character must be returned immediately:  no fooling
  104.         around waiting for a carriage-return before returning.
  105.     5.  If the NoWait argument is set, don't wait
  106.     6.  When the user hits the RETURN key,  TECO is supposed to see
  107.         a carriage return and then a line feed.  The function must
  108.         deal with this by returning a carriage return to the caller
  109.         and then "remembering" to send a line feed on the next call.
  110.     7.  handle ET_BKSP_IS_DEL flag
  111.  
  112. *****************************************************************************/
  113.  
  114. DEFAULT ZChIn(NoWait)            /* input a character from terminal */
  115. BOOLEAN NoWait;                /* return immediately? */
  116. {
  117.     puts("Terminating in function ZChIn.\n");
  118.     exit(EXIT_FAILURE);
  119. }
  120.  
  121. /*****************************************************************************
  122.  
  123.     ZClnEG()
  124.  
  125.     This function executes a :EG command.  The :EG commands are used to
  126. get access to operating system functions.  The minimum set of functions is
  127.  
  128.     :EGINI$        gets, sets or clears the initialization file name
  129.     :EGMEM$        gets, sets or clears the file name memory
  130.     :EGLIB$        gets, sets or clears the macro library directory
  131.     :EGVTE$        gets, sets or clears the video macro file name
  132.  
  133. although more functions may be defined.
  134.  
  135. *****************************************************************************/
  136.  
  137. LONG ZClnEG(EGWhat,EGOper,TxtPtr)
  138. DEFAULT EGWhat;            /* what to get/set/clear: MEM, LIB, etc. */
  139. DEFAULT EGOper;            /* operation: get, set or clear */
  140. charptr TxtPtr;            /* if setting,  value to set */
  141. {
  142.     puts("Terminating in function ZClnEG.\n");
  143.     exit(EXIT_FAILURE);
  144. }
  145.  
  146. /*****************************************************************************
  147.  
  148.     ZClnUp()
  149.  
  150.     This function cleans up in preparation for terminating TECO-C.
  151.  
  152. *****************************************************************************/
  153.  
  154. VVOID ZClnUp(void)            /* clean up for exit */
  155. {
  156.     puts("Terminating in function ZClnUp.\n");
  157.     exit(EXIT_FAILURE);
  158. }
  159.  
  160. /*****************************************************************************
  161.  
  162.     Zcp2ul()
  163.  
  164.     This function converts a pointer to an unsigned long.
  165.  
  166. *****************************************************************************/
  167.  
  168. #if DEBUGGING
  169. ULONG Zcp2ul(voidptr cp)        /* convert charptr to ULONG */
  170. {
  171.     return ((ULONG)(cp));
  172. }
  173. #endif
  174.  
  175. /*****************************************************************************
  176.  
  177.     ZDoCmd()
  178.  
  179.     This function terminates TECO and feeds a command line to the
  180. command line interpreter.
  181.  
  182. *****************************************************************************/
  183.  
  184. VVOID ZDoCmd()            /* die and pass command to OS */
  185. {
  186.     (void)ExeNYI();
  187. }
  188.  
  189. /*****************************************************************************
  190.  
  191.     ZDspBf()
  192.  
  193.     This function displays a buffer of a given length on the terminal
  194. screen.  On the VAX (and maybe other systems) doing any kind of output
  195. involves a fair amount of overhead,  regardless of the size of the buffer
  196. being output.  It is therefore better to make a single call to the operating
  197. system's output function than to call the function for each and every
  198. character.  If such improvements do not apply to the system this program
  199. is running on,  then this function can simply call ZDspCh for every character
  200. in the buffer.
  201.  
  202. *****************************************************************************/
  203.  
  204. VVOID ZDspBf(buffer, length)    /* output a buffer to terminal */
  205. charptr buffer;
  206. SIZE_T length;
  207. {
  208.     puts("Terminating in function ZDspBf.\n");
  209.     exit(EXIT_FAILURE);
  210. }
  211.  
  212. /*****************************************************************************
  213.  
  214.     ZDspCh()
  215.  
  216.     This function outputs a single character to the terminal.
  217.  
  218. *****************************************************************************/
  219.  
  220. VVOID ZDspCh(Charac)        /* output a character to terminal */
  221. char Charac;
  222. {
  223.     puts("Terminating in function ZDspCh.\n");
  224.     exit(EXIT_FAILURE);
  225. }
  226.  
  227. /*****************************************************************************
  228.  
  229.     ZExCtB()
  230.  
  231.     This function implements the TECO ^B command,  which returns the
  232. current date encoded in the following way:
  233.  
  234.         ((year-1900)*16+month)*32+day
  235.  
  236. *****************************************************************************/
  237.  
  238. DEFAULT ZExCtB()            /* return current date */
  239. {
  240.     return ExeNYI();
  241. }
  242.  
  243. /*****************************************************************************
  244.  
  245.     ZExCtH()
  246.  
  247.     This function implements the TECO ^H command,  which returns the
  248. current time encoded in the following way:
  249.  
  250.         (seconds since midnight) / 2
  251.  
  252. *****************************************************************************/
  253.  
  254. DEFAULT ZExCtH()            /* return current time */
  255. {
  256.     return ExeNYI();
  257. }
  258.  
  259. /*****************************************************************************
  260.  
  261.     ZExeEJ()
  262.  
  263.     This function executes an EJ command,  which returns environment
  264. characteristics.  It returns:
  265.  
  266.     -1EJ    1024 under VAX/VMS    (4*256 = VAX, 0 = VMS in native mode)
  267.         1025 under Ultrix    (4*256 = VAX, 1 = Ultrix)
  268.         25600 under Sun/SunOS    (100*256 = Sun, 0 = SunOS)
  269.         25856 under MS-DOS    (101*256 = IBM-PC, 0 = MS-DOS)
  270.  
  271.     0EJ    process id on VAXen, 0 on anything else
  272.  
  273.     1EJ    0 on all systems
  274.  
  275.     2EJ    UIC, in longword format (unlike TECO-11) on VAX/VMS,
  276.         0 on all other systems.
  277.  
  278. *****************************************************************************/
  279.  
  280. DEFAULT ZExeEJ()            /* execute an EJ command */
  281. {
  282.     return ExeNYI();
  283. }
  284.  
  285. /*****************************************************************************
  286.  
  287.     ZExit()
  288.  
  289.     This function terminates TECO-C with a status value.
  290.  
  291. *****************************************************************************/
  292.  
  293. VVOID ZExit(DEFAULT estat)        /* terminate TECO-C */
  294. {
  295.     exit(estat);
  296. }
  297.  
  298. /*****************************************************************************
  299.  
  300.     ZFree()
  301.  
  302.     This function frees memory previously allocated by the ZAlloc
  303. function.
  304.  
  305. *****************************************************************************/
  306.  
  307. VVOID ZFree(pointer)        /* free memory allocated by ZAlloc */
  308. voidptr pointer;
  309. {
  310.     puts("Terminating in function ZFree.\n");
  311.     exit(EXIT_FAILURE);
  312. }
  313.  
  314. /*****************************************************************************
  315.  
  316.     ZHelp()
  317.  
  318.     This function accepts a help string and displays the corresponding
  319. help text.
  320.  
  321.     it should be control-C interrupt-able.
  322.  
  323. *****************************************************************************/
  324.  
  325. VVOID ZHelp(HlpBeg, HlpEnd, SysLib, Prompt)
  326. charptr HlpBeg;            /* first char of help request */
  327. charptr HlpEnd;            /* last character of help request */
  328. BOOLEAN SysLib;            /* use default HELP library? */
  329. BOOLEAN    Prompt;            /* enter interactive help mode? */
  330. {
  331.     puts("Terminating in function ZHelp.\n");
  332.     exit(EXIT_FAILURE);
  333. }
  334.  
  335. /*****************************************************************************
  336.  
  337.     ZIClos()
  338.  
  339.     This function closes the current input file.  It must
  340.  
  341.     1.  if current input stream is not open,  simply return
  342.     2.  close the input file
  343.     3.  set open indicator to FALSE
  344.  
  345. *****************************************************************************/
  346.  
  347. VVOID ZIClos(IfIndx)            /* close input file */
  348. DEFAULT    IfIndx;                /* index into IFiles array */
  349. {
  350.     puts("Terminating in function ZIClos.\n");
  351.     exit(EXIT_FAILURE);
  352. }
  353.  
  354. /*****************************************************************************
  355.  
  356.     ZCpyBl()
  357.  
  358.     See the definition of MEMMOVE in ZPORT.H for a description of this
  359. function.
  360. *****************************************************************************/
  361.  
  362. #if defined(NEEDS_ZCPYBL)
  363.  
  364. VVOID ZCpyBl(Destin, Source, Length)
  365. charptr Destin;
  366. charptr Source;
  367. SIZE_T Length;
  368. {
  369.     if (Source < Destin) {
  370.         Source += Length;
  371.         Destin += Length;
  372.         while (Length-- > 0) {
  373.             *--Destin = *--Source;
  374.         }
  375.     } else {
  376.         while (Length-- > 0) {
  377.             *Destin++ = *Source++;
  378.         }
  379.     }
  380. }
  381.  
  382. /*****************************************************************************
  383.  
  384.     ZOClDe()
  385.  
  386.     This function closes and deletes the current output stream.  It must
  387.  
  388.     1.  if no current output stream is defined,  simply return
  389.     2.  close the output stream
  390.     3.  delete the file just closed
  391.  
  392. *****************************************************************************/
  393.  
  394. VVOID ZOClDe(OfIndx)            /* close and delete output file */
  395. DEFAULT    OfIndx;                /* index into OFiles array */
  396. {
  397.     puts("Terminating in function ZOClDe.\n");
  398.     exit(EXIT_FAILURE);
  399. }
  400.  
  401. /*****************************************************************************
  402.  
  403.     ZOClos()
  404.  
  405.     This function closes the current output stream.  It is only called
  406. when an output stream is defined.  It must
  407.  
  408.     1.  flush output to the stream,  if neccessary
  409.     2.  close the stream
  410.     3.  set OFile to -1
  411.  
  412. *****************************************************************************/
  413.  
  414. VVOID ZOClos(OfIndx)        /* close output file */
  415. DEFAULT    OfIndx;            /* index into OFiles array */
  416. {
  417.     puts("Terminating in function ZOClos.\n");
  418.     exit(EXIT_FAILURE);
  419. }
  420.  
  421. /*****************************************************************************
  422.  
  423.     ZOpInp()
  424.  
  425.     This function opens an input file.  The name of the file is pointed
  426. to by FBfBeg.  FBfPtr points to the character following the last character of
  427. the file name.
  428.  
  429. *****************************************************************************/
  430.  
  431. DEFAULT ZOpInp(IfIndx, EIFile, RepFNF)
  432. DEFAULT IfIndx;            /* index into file data block array IFiles */
  433. BOOLEAN    EIFile;            /* is it a macro file? (hunt for it) */
  434. BOOLEAN RepFNF;            /* report "file not found" error? */
  435. {
  436.     puts("Terminating in function ZOpInp.\n");
  437.     exit(EXIT_FAILURE);
  438. }
  439.  
  440. /*****************************************************************************
  441.  
  442.     ZOpOut()
  443.  
  444.     This function creates (and opens) an output file.  The name of
  445. the file to be created is pointed to by FBfBeg.  FBfPtr points to the
  446. character following the last character of the file name.
  447.  
  448. *****************************************************************************/
  449.  
  450. DEFAULT ZOpOut(OfIndx, RepErr)        /* open output file */
  451. DEFAULT    OfIndx;                /* output file indicator */
  452. BOOLEAN RepErr;                /* report errors? */
  453. {
  454.     puts("Terminating in function ZOpOut.\n");
  455.     exit(EXIT_FAILURE);
  456. }
  457.  
  458. /*****************************************************************************
  459.  
  460.     ZPrsCL()
  461.  
  462.     Parse the command line using a TECO macro.
  463.  
  464.     load q-register Z with the command line
  465.     if USE_ANSI_CLPARS
  466.         directly execute command-line parsing macro in clpars[]
  467.     else
  468.         load q-register Y with a command-line parsing macro
  469.         do an MY$$
  470.  
  471. *****************************************************************************/
  472.  
  473. VVOID ZPrsCL(int argc, char **argv)
  474. {
  475.     int    i;
  476.     char    TmpBuf[256];
  477.     SIZE_T    line_len;
  478.  
  479.     DBGFEN(2,"ZPrsCL",NULL);
  480.  
  481. /*
  482.  * If the command line contains arguments,  construct a replica of the
  483.  * command line in Q-register Z.  It's a "replica" because spacing might
  484.  * be wrong.
  485.  */
  486.  
  487.     if (argc > 1) {
  488.         TmpBuf[0] = '\0';
  489.         for (i = 1; i < argc; i++) {
  490.             strcat(TmpBuf, *++argv);
  491.             strcat(TmpBuf, " ");
  492.         }
  493.         line_len = strlen(TmpBuf)-1;    /* ignore trailing space */
  494.         QR = &QRgstr[35];        /* 35 = q-register Z */
  495.         if (MakRom(line_len) == FAILURE) {
  496.             DBGFEX(2,DbgFNm,
  497.                    "MakRom(line_len) failed, calling exit()");
  498.             exit(EXIT_FAILURE);
  499.         }
  500.         MEMMOVE(QR->Start, TmpBuf, line_len);
  501.         QR->End_P1 += line_len;        /* length of q-reg text */
  502.     }
  503.  
  504. #if USE_ANSI_CLPARS
  505.  
  506. /*
  507.  * execute imbedded command line-parsing macro directly from clpars[]
  508.  */
  509.  
  510.  
  511.     CStBeg = CBfPtr = clpars;        /* command string start */
  512.     CStEnd = clpars + CLPARS_LEN;        /* command string end */
  513.     EStTop = EStBot;            /* clear expression stack */
  514.     ExeCSt();                /* execute command string */
  515.  
  516. #else
  517.  
  518. /*
  519.  * Load imbedded command-line parsing macro into Q-register Y
  520.  */
  521.  
  522.     QR = &QRgstr[34];            /* 34 = q-register Y */
  523.     if (MakRom((SIZE_T)CLPARS_LEN) == FAILURE) {
  524.         DBGFEX(2,DbgFNm,"MakRom(CLPARS_LEN) failed, calling exit()");
  525.         exit(EXIT_FAILURE);
  526.     }
  527.     for (i = 0; i < CLPARS_LINES; i++) {
  528.         line_len = strlen(clpars[i]);
  529.         MEMMOVE(QR->End_P1, clpars[i], line_len);
  530.         QR->End_P1 += line_len;        /* length of q-reg text */
  531.     }
  532.  
  533. /*
  534.  * Execute an MY$$ command.
  535.  */
  536.  
  537.     CBfPtr = "my\33\33";            /* command string start */
  538.     CStEnd = CBfPtr + 3;            /* command string end */
  539.     EStTop = EStBot;            /* clear expression stack */
  540.     ExeCSt();                /* execute command string */
  541.  
  542. /*
  543.  * Clear the command-line parsing macro from Q-register Y
  544.  */
  545.  
  546.     QR = &QRgstr[34];            /* 34 = q-register Y */
  547.     ZFree (QR->Start);
  548.     QR->Start = QR->End_P1 = NULL;
  549.  
  550. #endif
  551.  
  552.     DBGFEX(2,DbgFNm,NULL);
  553. }
  554.  
  555. /*****************************************************************************
  556.  
  557.     ZPWild()
  558.  
  559.     This function presets the wildcard lookup filename.  It is
  560. called when the user executes an ENfilename$ command.  Later executions of
  561. the EN$ command will cause the ZSWild function to be called to return
  562. successive wildcard matches.
  563.  
  564. *****************************************************************************/
  565.  
  566. DEFAULT ZPWild()        /* preset the wildcard lookup filename */
  567. {
  568.     puts("Terminating in function ZPWild.\n");
  569.     exit(EXIT_FAILURE);
  570. }
  571.  
  572. /*****************************************************************************
  573.  
  574.     ZRaloc()
  575.  
  576.     This function performs the standard C library function realloc.
  577.  
  578. *****************************************************************************/
  579.  
  580. voidptr ZRaloc(OldBlk, NewSiz)
  581. voidptr OldBlk;
  582. SIZE_T NewSiz;
  583. {
  584.     return realloc(OldBlk, NewSiz);
  585. }
  586.  
  587. /*****************************************************************************
  588.  
  589.         ZRdLin()
  590.  
  591.         This function reads a line from a file.  It is passed a buffer, the
  592. size of the buffer, a file pointer.  It returns the length of the line,  or
  593. sets IsEofI[] to TRUE if the end of file is encountered.
  594.  
  595. *****************************************************************************/
  596.  
  597. DEFAULT ZRdLin(buf, buflen, fidx, length)
  598. charptr buf;
  599. SIZE_T buflen;
  600. int fidx;
  601. DEFAULT *length;
  602. {
  603.     puts("Terminating in function ZRdLin.\n");
  604.     exit(EXIT_FAILURE);
  605. }
  606.  
  607. /*****************************************************************************
  608.  
  609.     ZScrOp()
  610.  
  611.     This function is called to perform special screen functions.
  612.  
  613. *****************************************************************************/
  614.  
  615. VVOID ZScrOp(OpCode)        /* do a screen operation */
  616. int OpCode;            /* code for operation */
  617.  
  618. {
  619.     int index;
  620.     static int map[] = {
  621.         1,    /* 0 - VT52 is a VT52 */
  622.         2,    /* 1 - VT61 is a VT61 */
  623.         1,    /* 2 - VT100 in VT52 mode is a VT52 */
  624.         0,    /* 3 - unused */
  625.         3,    /* 4 - VT100 in ANSI mode is a VT100 */
  626.         0,    /* 5 - unused */
  627.         0,    /* 6 - VT05 is a VT05 */
  628.         0,    /* 7 - unused */
  629.         3,    /* 8 - VT102 is a VT100 */
  630.         0,    /* 9 - unused */
  631.         3,    /* 10 - VK100 is a VT100 */
  632.         3,    /* 11 - VT200 in VT200 mode is a VT100 */
  633.         3,    /* 12 - VT200 in VT100 mode is a VT100 */
  634.         1,    /* 13 - VT200 in VT52 mode is a VT52 */
  635.     };
  636.     struct strng
  637.         {
  638.         charptr strt;
  639.         DEFAULT len;
  640.         };
  641.     static struct strng CUP[] = {        /* cursor up one line */
  642.         {"\232\0\0\0\0",    5},    /* VT05 - ? */
  643.         {"\033A",        2},    /* VT52 - ESC A */
  644.         {"",            0},    /* VT61 */
  645.         {"\033[A",        3}    /* VT100 - ESC [ A */
  646.     };
  647.     static struct strng EEL[] = {        /* erase to end of line */
  648.         {"\36",            1},    /* VT05 - RS */
  649.         {"\033K\r",        3},    /* VT52 - ESC K CR */
  650.         {"",            0},    /* VT61 */
  651.         {"\033[K",        3}    /* VT100 - ESC [ K */
  652.     };
  653.     static struct strng ROF[] = {        /* reverse video on */
  654.         {"",            0},    /* VT05 */
  655.         {"",            0},    /* VT52 */
  656.         {"",            0},    /* VT61 */
  657.         {"\033[m",        3}    /* VT100 - ESC [ m */
  658.     };
  659.     static struct strng RON[] = {        /* reverse video off */
  660.         {"",            0},    /* VT05 */
  661.         {"",            0},    /* VT52 */
  662.         {"",            0},    /* VT61 */
  663.         {"\033[7m",        4}    /* VT100 - ESC [ 7 m */
  664.     };
  665.  
  666.     if (CrType == UNTERM) {        /* if unknown terminal type */
  667.         return;            /* can't do screen operations */
  668.     }
  669.  
  670. /*
  671.  * The numbering used for CrType comes from TECO-11.  Convert it to get an
  672.  * index into the string arrays.
  673.  */
  674.     index = map[CrType];
  675.  
  676.     switch (OpCode) {
  677.         case SCR_CUP:   ZDspBf(CUP[index].strt, CUP[index].len);   break;
  678.         case SCR_EEL:   ZDspBf(EEL[index].strt, EEL[index].len);   break;
  679.         case SCR_ROF:   ZDspBf(ROF[index].strt, ROF[index].len);   break;
  680.         case SCR_RON:   ZDspBf(RON[index].strt, RON[index].len);   break;
  681.     }
  682. }
  683.  
  684. /*****************************************************************************
  685.  
  686.     ZSetTT()
  687.  
  688.     This function sets or clears terminal parameters.  The only terminal
  689. parameters that TECO can set are
  690.  
  691.     1. whether the terminal can display 8-bit characters
  692.     2. the number of rows
  693.     3. the number of columns
  694.  
  695. *****************************************************************************/
  696.  
  697. DEFAULT ZSetTT(        /* tell operating system that we set the terminal */
  698. DEFAULT TTWhat,        /* what terminal parameter to set */
  699. DEFAULT TTVal)        /* what to set it to */
  700. {
  701.     return ExeNYI();
  702. }
  703.  
  704. /*****************************************************************************
  705.  
  706.     ZSWild()
  707.  
  708.     This function searches for the next wildcard filename.  It
  709. is called when the user executes an "EN$" or ":EN$" command.  If the user
  710. executes an "ENfilename$" command,  the ZPWild function is called,  not this
  711. function.
  712.  
  713.     This function returns
  714.  
  715.         1. SUCCESS if the filename buffer has a new file name
  716.         2. FAILURE if the search failed somehow other than FILENF
  717.         3. FILENF if no more occurrences of the wildcard exist
  718.  
  719. *****************************************************************************/
  720.  
  721. DEFAULT ZSWild()            /* search for next wildcard filename */
  722. {
  723.     puts("Terminating in function ZSWild.\n");
  724.     exit(EXIT_FAILURE);
  725. }
  726.  
  727. /*****************************************************************************
  728.  
  729.     ZTrmnl()
  730.  
  731.     This function sets up the input/output of commands.  Usually, that
  732. means the input/output channels to the terminal,  but TECOC might be run
  733. from a command procedure (under VMS) or a script file (under __UNIX__),  and
  734. that possibility must be handled.  In addition,  the handling of interrupts
  735. is found here.
  736.     In general,  this function must:
  737.  
  738.         1. Set TIChan so it can be used to read commands
  739.         2. Set TOChan so it can be used for output
  740.         3. handle interrupts
  741.         4. initialize CrType (what kind of terminal it is)
  742.         5. initialize EtFlag (terminal capability bits)
  743.         6. initialize HtSize (number columns terminal has)
  744.         7. initialize VtSize (number rows terminal has)
  745.  
  746. *****************************************************************************/
  747.  
  748. VVOID ZTrmnl()        /* set up I/O to the terminal */
  749. {
  750.     puts("Failing in function ZTrmnl\n");
  751.     exit(EXIT_FAILURE);
  752. }
  753.  
  754. /*****************************************************************************
  755.  
  756.     ZVrbos()
  757.  
  758.     This function s a buffer to a file.
  759.  
  760. *****************************************************************************/
  761.  
  762. VVOID ZVrbos(ErrNum, ErMnem)
  763. WORD ErrNum;
  764. char *ErMnem;
  765. {
  766.     char **TmpPtr;
  767. #include "vrbmsg.h"
  768.  
  769.     ZDspBf("\r\n",2);
  770.     for (TmpPtr = &ParaTx[StartP[LstErr]]; *TmpPtr; ++TmpPtr) {
  771.         ZDspBf((charptr)*TmpPtr, strlen(*TmpPtr));
  772.         ZDspBf("\r\n",2);
  773.     }
  774. }
  775.  
  776. /*****************************************************************************
  777.  
  778.     ZWrLin()
  779.  
  780.     This function writes a line to a file.
  781.  
  782. *****************************************************************************/
  783.  
  784. DEFAULT ZWrLin(OfIndx, BfrBeg, RecSiz)
  785. DEFAULT    OfIndx;            /* index into OFiles array */
  786. charptr BfrBeg;            /* address of output buffer */
  787. ptrdiff_t RecSiz;        /* record size */
  788. {
  789.     puts("Terminating in function ZWrLin.\n");
  790.     exit(EXIT_FAILURE);
  791. }
  792.